package address.controller;

import address.MainApp;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.stage.Stage;

import java.io.IOException;

//等待格式化
public class ErrorMoveController {

    private static Stage errorStage = new Stage();

    public static void showErrorStage() {
        try {
            FXMLLoader loader = new FXMLLoader();
            loader.setLocation(MainApp.class.getResource("view/ErrorMove.fxml"));
            AnchorPane error = (AnchorPane) loader.load();
            Scene scene = new Scene(error);

            errorStage.setScene(scene);
            errorStage.show();
            errorStage.setTitle("ErrorMassage");
        } catch (IOException e) {
            System.out.println("oh shit,here we go again.");
            //e.printStackTrace();
        }
    }

    @FXML
    private void handleOK() {
        errorStage.close();
    }
}
